package chapter02;

import java.util.Arrays;

public class Test03_TwoDim {
    public static void main(String[] args) {
        //二维数组的定义
        //规定行列的
        int[][] a = new int[3][3];
        System.out.println(Arrays.deepToString(a));
        //行确定 列不确定
        int[][] b = new int[3][];
        b[0] = new int[2];
        b[1] = new int[3];
        b[2] = new int[1];
        System.out.println(Arrays.deepToString(b));
        //直接给值
        int[][] c = {{1,2,3},{4,5,6},{7,8,9}};
        System.out.println(Arrays.deepToString(c));
        //更改其中的值
        c[0][0] = 100;
        System.out.println(Arrays.deepToString(c));
        //循环遍历
        for(int i=0;i<c.length;i++){
            System.out.println(Arrays.toString(c[i]));
            for(int j=0;j<c[i].length;j++){
                System.out.println(c[i][j]);
            }
        }
    }
}
